Method for determining height of plant, electronic device, and storage medium

ABSTRACT

A method for determining a height of a plant, an electronic device, and a storage medium are disclosed. In the method, a target image is obtained by mapping an obtained color image with an obtained depth image. The electronic device processes the color image by using a pre-trained mobilenet-ssd network, obtains a detection box appearance of the plant, and extracts target contours of the plant to be detected from the detection box. The electronic device determines a depth value of each of pixel points in the target contour according to the target image. Target depth values are obtained by performing a de-noising on depth values of the pixel points, and a height of the plant to be detected is determined according to the target depth value. The method improves accuracy of height determination of a plant.

FIELD

The present application relates to a technical field of image analysis,and more particularly to a method for determining a height of a plant,an electronic device, and a storage medium.

BACKGROUND

To increase yield and quality of plants, it is helpful to determine abetter planting method for plants by analyzing a daily growth of theplants, thereby reducing planting costs. However, when analyzing growthof the plants by using images, some irrelevant information such asleaves, weeds, etc. shown in the image may influence an accuracy of agrowth analysis of the plants.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a camera device in communication with anelectronic device in an embodiment of the present application.

FIG. 2 is a flowchart diagram of a method of determining a height of aplant in an embodiment of the present application.

FIG. 3 is a structural diagram of a determination device for determininga height of a plant in an embodiment of the present application.

FIG. 4 is a structural diagram of an electronic device in an embodimentof the present application.

DETAILED DESCRIPTION

The accompanying drawings combined with the detailed descriptionillustrate the embodiments of the present disclosure hereinafter. It isnoted that embodiments of the present disclosure and features of theembodiments can be combined, when there is no conflict.

Various details are described in the following descriptions for a betterunderstanding of the present disclosure, however, the present disclosuremay also be implemented in other ways other than those described herein.The scope of the present disclosure is not to be limited by the specificembodiments disclosed below. Unless defined otherwise, all technical andscientific terms used herein have the same meaning as commonlyunderstood by one of ordinary skill in the art to which the presentdisclosure belongs. The terms used herein in the present disclosure areonly for the purpose of describing specific embodiments and are notintended to limit the present disclosure.

FIG. 1 is a block diagram of a camera device in communication with anelectronic device in an embodiment of the present application. As shownin FIG. 1, a camera device 2 communicates with an electronic device 1,and the camera device 2 includes a first lens 20 and a second lens 21.The first lens 20 can capture color images, and the second lens 21 cancapture depth images.

FIG. 2 is a flowchart diagram of a method for determining a height of aplant in an embodiment of the present application.

In one embodiment, the method for determining a height of a plant may beapplied to one or more electronic devices 1. The electronic device 1includes hardware such as, but is not limited to, a microprocessor andan Application Specific Integrated Circuit (ASIC), a Field-ProgrammableGate Array (FPGA), a Digital Signal Processor (DSP), embedded devices,for example.

The electronic device 1 may be any electronic product that can interactwith a user, such as a personal computer, a tablet computer, a smartphone, a personal digital assistant (Personal Digital Assistant, PDA), agame console, an interactive network television (Internet ProtocolTelevision, IPTV), or smart wearable device, for example.

The electronic device 1 may also include a network device and/or a userdevice. The network device includes, but is not limited to, a singlenetwork server, a server group including multiple network servers, or acloud including a large quantity of hosts or network servers based on acloud computing technology.

A network can include, but is not limited to, the Internet, a wide areanetwork, a metropolitan area network, a local area network, and avirtual private network (VPN), for example.

In block S10, the electronic device 1 obtains a color image and a depthimage of a plant to be detected.

In one embodiment, the color image can be a red, green, blue (RGB)three-channel color image, and the depth image can be an image of whichpixel values indicate a distance from an image collector to each pointin a captured scene.

In one embodiment, the color image and the depth image can be obtainedfrom the camera device 2 or from a configuration library. Moreover, thecolor image and the depth image both include the plant to be detected.

In one embodiment, the color image and the depth image of the plant tobe detected can be obtained by performing a following procedure. Thefirst lens 20 of the camera device 2 is controlled to capture the plantto be detected, and the color image is obtained. Then the second lens 21of the camera device 2 is also controlled to capture the plant to bedetected, and the depth image is obtained.

The camera device 2 includes dual lenses, such as the first lens 20 andthe second lens 21 as mentioned above. The camera device 2 may bepositioned above the plant to be detected.

Moreover, the plant to be detected may be any plant that needs to beanalyzed for daily growth, such as roses, sunflowers, or rice plant, forexample.

Specifically, in response that the plant to be detected is directly infront of the camera device 2, the electronic device 1 controls the firstlens 20 to shoot the plant to be detected and obtains the color image.The electronic device 1 controls the second lens 21 to shoot the plantto be detected and obtains the depth image.

According to the above embodiments, the color image and the depth imageof the plant to be detected can be quickly obtained.

In one embodiment, the electronic device 1 determines a label of theplant to be detected, further, the electronic device 1 obtains an imagewith the label from the first configuration library as the color image,and the electronic device 1 obtains an image with the label from thesecond configuration library as the depth image. The label may indicatethe plant to be detected, for example, the label may be 0001.

The first configuration library stores a mapping relationship between aplurality of color images and a plurality of labels, and the secondconfiguration library stores a mapping relationship between a pluralityof depth images and the plurality of labels.

The color image can be accurately obtained through a mappingrelationship between the label and the color image, and then the depthimage can be accurately obtained through a mapping relationship betweenthe label and the depth image.

In block S11, the electronic device 1 obtains a target image byperforming a mapping processing on the color image and the depth image.

In one embodiment, the target image can be an image generated by mergingpixels of the color image with pixels of the depth image.

In one embodiment, the electronic device 1 acquires depth pixel pointson the depth image, the electronic device 1 further maps the depth pixelpoints to a preset depth coordinate system and obtains depth coordinatesof the depth pixel points. The electronic device 1 determines globalcoordinates of the depth pixel points according to the depth coordinatesand a preset global coordinate system. Then, the electronic device 1determines positions of the depth pixel points on the color imageaccording to the global coordinates of the depth pixel points anddetermines color pixel points corresponding to the positions on thecolor image. Moreover, the electronic device 1 obtains the target imageby merging each of the depth pixel points with corresponding color pixelpoints.

The preset depth coordinate system and the preset global coordinatesystem can be obtained from an open source system or can be preset by auser according to the actual requirements, not being limited in thepresent application.

According to the above embodiment, the generation of a target image thatincludes a depth value is helpful for a subsequent determination of agrowth height of the plant to be detected.

In block S12, the electronic device 1 detects the color image by using apre-trained mobilenet-ssd network and obtains a detection box in whichthe plant to be detected.

In one embodiment, the detection box is obtained by using a convolutioncheck in the mobilenet-ssd network and features of the color image areextracted.

In one embodiment, before the electronic device 1 detects the colorimage by using a pre-trained mobilenet-ssd network, the electronicdevice 1 obtains a detection box including the plant to be detected, afield that the plant to be detected can be determined. A plurality ofcolor training images is obtained in the field. The electronic device 1fuses the plurality of color training images and obtains a data set. Thedata set is divided into a training set and a verification set. Further,a learner is obtained by training an open-source convolution networkusing color training images in the training set. The pre-trainedmobilenet-ssd network is obtained by adjusting the learner using colortraining images in the verification set.

In one embodiment, before the data set is divided into a training setand a verification set, a number of color training images in the dataset are calculated, and the number of color training images in the dataset are increased by using a data enhancement algorithm in response thatthe number of color training images is less than a preset number.

According to the above embodiments, the risk of poor generalization ofthe pre-trained mobilenet-ssd network is thereby avoided.

In one embodiment, the data set is randomly divided into at least onedata packet according to a preset ratio. Any one of the at least onedata packet can be determined as the verification set, and the remainingdata packets are determined to be the training set. The aboveembodiments can be repeated until one of the at least one data packet isdetermined as the verification set.

The preset ratio can be customized, and the preset ratio is not limited.

According to the above embodiments, each of the color training images inthe training data is involved in training and verification procedures,thereby improving the pre-training of the pre-trained mobilenet-ssdnetwork.

In one embodiment, the electronic device 1 determines an optimizedhyperparameter point from the verification set by performing ahyperparameter grid search method. Moreover, the electronic device 1adjusts the learner according to the optimized hyperparameter point andobtains the pre-trained mobilenet-ssd network.

Specifically, the electronic device 1 splits the verification setaccording to a preset step size and obtains a target subset. Theelectronic device 1 traverses parameters of two ends on the targetsubset, verifies the learner by using the parameters of the two ends onthe target subset, and obtains a learning rate of each of theparameters. The electronic device 1 determines a parameter in theneighborhood of the first hyperparameter point with the largest learningrate as a first hyperparameter point. The electronic device 1 reducesthe preset step size and continues traversing until the length of a stepsize after reduction is equal to a preset step length, and determines ahyperparameter point as being the optimized hyperparameter point.Furthermore, the electronic device 1 adjusts the learner according tothe optimized hyperparameter point, and obtains the pre-trainedmobilenet-ssd network.

The preset step length is not limited.

The pre-trained mobilenet-ssd network is more effective in analyzing thecolor image.

In one embodiment, a depth convolution kernel and a point convolutionkernel are acquired in the pre-trained mobilenet-ssd network. A featuremap is obtained by extracting features of the color image with the depthconvolution kernel, and the detection box is obtained by processing thefeature map with the point convolution kernel.

The depth convolution kernel may be a 16*16*128 matrix, and the pointconvolution kernel may be a 1*1*16 matrix.

The detection box can be detected quickly through the pre-trainedmobilenet-ssd network, and the detection efficiency can be improved.

In block S13, the electronic device 1 extracts a target contour of theplant to be detected from the detection box.

In one embodiment, the target contour of the plant to be detected refersto a contour after removing irrelevant information in the detection box,and the shape of the target contour is determined according to the shapeof the plant to be detected.

In one embodiment, a background image is deleted from the detection box,and a grayscale image is obtained. The target contour of the plant to bedetected is detected on the grayscale image.

By deleting the background image, interference caused by the backgroundimage can be avoided, and the accuracy of extracting the target contourcan be improved.

In block S14, the electronic device 1 determines a depth value of eachof pixel point in the target contour according to the target image.

In one embodiment, the depth value refers to a height of a feature pointfrom the camera device 2. The feature point can be a pixel correspondingto the depth image of the plant to be detected.

In one embodiment, the electronic device 1 determines a target positionof each of the pixel points on the target image, and the electronicdevice 1 obtains a depth value at the target position from the targetimage as the depth value of each of the pixel points.

By determining the depth value of each of pixel points in the targetcontour according to the target image, the depth value of each of pixelpoints can be accurately and quickly determined.

In block S15, the electronic device 1 performs a de-noising processingon depth values of the pixel points, and obtains target depth values,and determines a height of the plant to be detected according to thetarget depth values.

In one embodiment, a depth value is determined as a zero value, thedetermined depth value is equal to a preset value, the electronic device1 performs a de-noising processing by deleting the zero value from thedepth values of the pixel points, and remaining depth values aredetermined as the target depth values. A number of target depth valuesare determined, and a sum is obtained by counting the target depthvalues. A distance is calculated between the plant to be detected andthe camera device by dividing the sum by the number of the target depthvalues. The electronic device 1 determines a height of a location wherethe camera device is located, and the electronic device 1 determines theheight of the plant to be detected by subtracting the distance from theheight of the camera device.

By performs a de-noising processing on depth values of the pixel points,and target depth values are obtained, it can be ensured that there is noirrelevant information in the target depth values, and the height of theplant to be detected can be accurately determined according to thetarget depth values.

In one embodiment, in response that the height of the plant to bedetected is less than a preset height, warning information is generatedaccording to the height of the plant to be detected. The warninginformation is encrypted by using a symmetric encryption algorithm and acipher text is obtained, an alarm level of the cipher text is determinedaccording to the plant to be detected. Then an alarm mode is determinedaccording to the alarm level of the cipher text, and the cipher text issent by the alarm mode.

The preset height can be set according to an expected growth rate of theplant to be detected, the above embodiments do not limit the value ofthe preset height. The alarm level includes level one, level two, and soon. The alarm mode includes an audio alarm using a loudspeaker, an emailmode, and a telephone mode, for example.

According to the above embodiments, in response that the height of theplant to be detected is less than the preset height, the warninginformation can be issued. In addition, the warning information can beprotected against tampering by encrypting the warning information, andsecurity of the warning information can be improved. Moreover, thewarning information can be sent in an appropriate alarm mode bydetermining the alarm mode according to the alarm level. Thus, thewarning information can be output in a more user-friendly way.

In the above embodiments, by performing a mapping processing on thecolor image and the depth image, thereby obtaining the target imageincluding the depth value, and then the detection box can be quicklydetected through the pre-trained mobilenet-ssd network, the detectionefficiency can be improved, the target contours of the plant to bedetected can be extracted from the detection box, and the targetcontours minus irrelevant information can be extracted. By determiningthe depth value of each of pixel points in the target contour accordingto the target image, the depth value of each of pixel points can beaccurately and quickly determined, and then the target depth value canbe obtained by performing a de-noising processing on depth values of thepixel points, which can ensure that there is no irrelevant informationin the target depth values again. The height of the plant to be detectedcan be accurately determined according to the target depth values.

FIG. 3 is a structural diagram of a determination device for determininga height of a plant in an embodiment of the present application.

As shown in FIG. 3, a determination device 11 for determining a heightof a plant includes an acquisition module 110, a map module 111, adetection module 112, an extraction module 113, a determination module114, a fusion module 115, a dividing module 116, a training module 117,an adjustment module 118, a calculation module 119, an enhancementmodule 120, a generation module 121, an encryption module 122, and asending module 123. The modules in the present application refer to oneof a stored series of computer-readable instruction segments that can beexecuted by at least one processor and that are capable of performingpreset functions. In some embodiments, the functions of each module willbe described.

The acquisition module 110 obtains a color image and a depth image of aplant to be detected.

In one embodiment, the color image can be a red, green, blue (RGB)three-channel color image, and the depth image can be an image of whichpixel values indicate a distance from an image collector to each pointin a captured scene.

In one embodiment, the color image and the depth image can be obtainedfrom the camera device 2 or from a configuration library. The colorimage and the depth image both include the plant to be detected.

In one embodiment, the color image and the depth image of the plant tobe detected can be obtained by performing a following procedure. Thefirst lens 20 of the camera device 2 is controlled to capture the plantto be detected, and the color image is obtained. Then the second lens 21of the camera device 2 is also controlled to capture the plant to bedetected, and the depth image is obtained.

The camera device 2 includes dual lenses, such as the first lens 20 andthe second lens 21 as mentioned above. The camera device 2 may bepositioned above the plant to be detected.

Moreover, the plant to be detected may be any plant that needs to beanalyzed for daily growth, such as roses, sunflowers, or rice plant, forexample.

Specifically, in response that the plant to be detected is directly infront of the camera device 2, the acquisition module 110 controls thefirst lens 20 to shoot the plant to be detected and obtains the colorimage. The acquisition module 110 controls the second lens 21 to shootthe plant to be detected and obtains the depth image.

According to the above embodiments, the color image and the depth imageof the plant to be detected can be quickly obtained.

In one embodiment, the acquisition module 110 determines a label of theplant to be detected, further, the acquisition module 110 obtains animage with the label from the first configuration library as the colorimage, and the acquisition module 110 obtains an image with the labelfrom the second configuration library as the depth image. The label mayindicate the plant to be detected, for example, the label may be 0001.

The first configuration library stores a mapping relationship between aplurality of color images and a plurality of labels, and the secondconfiguration library stores a mapping relationship between a pluralityof depth images and the plurality of labels.

The color image can be accurately obtained through a mappingrelationship between the label and the color image, and then the depthimage can be accurately obtained through a mapping relationship betweenthe label and the depth image.

The map module 111 obtains a target image by performing a mappingprocessing on the color image and the depth image.

In one embodiment, the target image can be an image generated by mergingpixels of the color image with pixels of the depth image.

In one embodiment, the map module 111 acquires depth pixel points on thedepth image, the map module 111 further maps the depth pixel points to apreset depth coordinate system and obtains depth coordinates of thedepth pixel points. The map module 111 determines global coordinates ofthe depth pixel points according to the depth coordinates and a presetglobal coordinate system. Then, the map module 111 determines positionsof the depth pixel points on the color image according to the globalcoordinates of the depth pixel points and determines color pixel pointscorresponding to the positions on the color image. Moreover, the mapmodule 111 obtains the target image by merging each of the depth pixelpoints with corresponding color pixel points.

The preset depth coordinate system and the preset global coordinatesystem can be obtained from an open source system or can be preset by auser according to the actual requirements, not being limited in thepresent application.

According to the above embodiment, the generation of a target image thatincludes a depth value is helpful for a subsequent determination of agrowth height of the plant to be detected.

The detection module 112 detects the color image by using a pre-trainedmobilenet-ssd network, and obtains a detection box in which the plant tobe detected.

In one embodiment, the detection box is obtained by using a convolutioncheck in the mobilenet-ssd network and features of the color image areextracted.

In one embodiment, before the detection module 112 detects the colorimage by using a pre-trained mobilenet-ssd network, and obtains adetection box including the plant to be detected, a field that the plantto be detected can be determined by a determination module 114. Aplurality of color training images are obtained in the field. The fusionmodule 115 fuses the plurality of color training images and obtains adata set. The data set is divided into a training set and a verificationset by the dividing module 116. Further, a learner is obtained by thetraining module 117 training an open-source convolution network usingcolor training images in the training set. The pre-trained mobilenet-ssdnetwork is obtained by the adjustment module 118 adjusting the learnerusing color training images in the verification set.

In one embodiment, before the data set is divided into a training setand a verification set, a number of color training images in the dataset are calculated, and the number of color training images in the dataset are increased by using a data enhancement algorithm in response thatthe number of color training images is less than a preset number.

According to the above embodiments, the risk of poor generalization ofthe pre-trained mobilenet-ssd network is thereby avoided.

In one embodiment, the data set is randomly divided into at least onedata packet according to a preset ratio. Any one of the at least onedata packet can be determined as the verification set, and the remainingdata packets are determined to be the training set. The aboveembodiments can be repeated until one of the at least one data packet isdetermined as the verification set.

The preset ratio can be customized, and the preset ratio is not limited.

According to the above embodiments, each of the color training images inthe training data is involved in training and verification procedures,thereby improving the pre-training of the pre-trained mobilenet-ssdnetwork.

In one embodiment, the adjustment module 118 determines an optimizedhyperparameter point from the verification set by performing ahyperparameter grid search method. Moreover, the adjustment module 118adjusts the learner according to the optimized hyperparameter point andobtains the pre-trained mobilenet-ssd network.

Specifically, the adjustment module 118 splits the verification setaccording to a preset step size and obtains a target subset. Theadjustment module 118 traverses parameters of two ends on the targetsubset, verifies the learner by using the parameters of the two ends onthe target subset, and obtains a learning rate of each of theparameters. The adjustment module 118 determines a parameter in theneighborhood of the first hyperparameter point with the largest learningrate as a first hyperparameter point. The adjustment module 118 reducesthe preset step size and continues traversing until the length of a stepsize after reduction is equal to a preset step length, and determines ahyperparameter point as being the optimized hyperparameter point.Furthermore, the adjustment module 118 adjusts the learner according tothe optimized hyperparameter point and obtains the pre-trainedmobilenet-ssd network.

The preset step length is not limited.

The pre-trained mobilenet-ssd network is more effective in analyzing thecolor image.

In one embodiment, a depth convolution kernel and a point convolutionkernel are acquired in the pre-trained mobilenet-ssd network. A featuremap is obtained by extracting features of the color image with the depthconvolution kernel, and the detection box is obtained by processing thefeature map with the point convolution kernel.

The depth convolution kernel may be a 16*16*128 matrix, and the pointconvolution kernel may be a 1*1*16 matrix.

The detection box can be detected quickly through the pre-trainedmobilenet-ssd network, and the detection efficiency can be improved.

The extraction module 113 extracts a target contour of the plant to bedetected from the detection box.

In one embodiment, the target contour of the plant to be detected refersto a contour after removing irrelevant information in the detection box,and the shape of the target contour is determined according to the shapeof the plant to be detected.

In one embodiment, a background image is deleted from the detection box,and a grayscale image is obtained. The target contour of the plant to bedetected is detected on the grayscale image.

By deleting the background image, interference caused by the backgroundimage can be avoided, and the accuracy of extracting the target contourcan be improved.

The determination module 114 determines a depth value of each of pixelpoints in the target contour according to the target image.

In one embodiment, the depth value refers to a height of a feature pointfrom the camera device 2. The feature point can be a pixel correspondingto the depth image of the plant to be detected.

In one embodiment, the determination module 114 determines a targetposition of each of the pixel points on the target image, and thedetermination module 114 obtains a depth value at the target positionfrom the target image as the depth value of each of the pixel points.

By determining the depth value of each of pixel points in the targetcontour according to the target image, the depth value of each of pixelpoints can be accurately and quickly determined.

The determination module 114 performs a de-noising processing on depthvalues of the pixel points, and obtains target depth values, anddetermines a height of the plant to be detected according to the targetdepth values.

In one embodiment, a depth value is determined as a zero value, thedetermined depth value is equal to a preset value, the determinationmodule 114 performs a de-noising processing by deleting the zero valuefrom the depth values of the pixel points, and remaining depth valuesare determined as the target depth values. A number of the target depthvalues are determined, and a sum is obtained by counting the targetdepth values. A distance is calculated between the plant to be detectedand the camera device by dividing the sum by the number of the targetdepth values. The determination module 114 determines a height of alocation where the camera device is located, and the determinationmodule 114 determines the height of the plant to be detected bysubtracting the distance from the height of the camera device.

By performs a de-noising processing on depth values of the pixel points,and target depth values are obtained, it can be ensured that there is noirrelevant information in the target depth values, and the height of theplant to be detected can be accurately determined according to thetarget depth values.

In one embodiment, in response that the height of the plant to bedetected is less than a preset height, warning information is generatedaccording to the height of the plant to be detected. The warninginformation is encrypted by using a symmetric encryption algorithm and acipher text is obtained, an alarm level of the cipher text is determinedaccording to the plant to be detected. Then an alarm mode is determinedaccording to the alarm level of the cipher text, and the cipher text issent by the alarm mode.

The preset height can be set according to an expected growth rate of theplant to be detected, the above embodiments do not limit the value ofthe preset height. The alarm level includes level one, level two, and soon. The alarm mode includes an audio alarm using a loudspeaker, an emailmode, and a telephone mode, for example.

According to the above embodiments, in response that the height of theplant to be detected is less than the preset height, the warninginformation can be issued. In addition, the warning information can beprotected against tampering by encrypting the warning information, andsecurity of the warning information can be improved. Moreover, thewarning information can be sent in an appropriate alarm mode bydetermining the alarm mode according to the alarm level. Thus, thewarning information can be output in a more user-friendly way.

In the above embodiments, by performing a mapping processing on thecolor image and the depth image, thereby obtaining the target imageincluding the depth value, and then the detection box can be quicklydetected through the pre-trained mobilenet-ssd network, the detectionefficiency can be improved, the target contours of the plant to bedetected can be extracted from the detection box, and the targetcontours minus irrelevant information can be extracted. By determiningthe depth value of each of pixel points in the target contour accordingto the target image, the depth value of each of pixel points can beaccurately and quickly determined, and then the target depth value canbe obtained by performing a de-noising processing on depth values of thepixel points, which can ensure that there is no irrelevant informationin the target depth values again. The height of the plant to be detectedcan be accurately determined according to the target depth values.

FIG. 4 is a structural diagram of an electronic device in an embodimentof the present application. The electronic device 1 may include astorage device 12, at least one processor 13, and computer-readableinstructions stored in the storage device 12 and executable by the atleast one processor 13, for example, a growth height of a plantdetermination programs.

Those skilled in the art will understand that FIG. 4 is only an exampleof the electronic device 1 and does not constitute a limitation on theelectronic device 1. Another electronic device 1 may include more orfewer components than shown in the figures or may combine somecomponents or have different components. For example, the electronicdevice 1 may further include an input/output device, a network accessdevice, a bus, and the like.

The at least one processor 13 can be a central processing unit (CPU), orcan be another general-purpose processor, digital signal processor(DSPs), application-specific integrated circuit (ASIC),Field-Programmable Gate Array (FPGA), another programmable logic device,discrete gate, transistor logic device, or discrete hardware component,etc. The processor 13 can be a microprocessor or any conventionalprocessor. The processor 13 is a control center of the electronic device1 and connects various parts of the entire electronic device 1 by usingvarious interfaces and lines.

The processor 13 executes the computer-readable instructions toimplement the method for determining a growth height of a plant asmentioned in the above embodiments, such as in block S10-S15 shown inFIG. 2. Alternatively, the processor 13 executes the computer-readableinstructions to implement the functions of the modules/units in theforegoing device embodiments, such as the modules 110-123 in FIG. 3.

For example, the computer-readable instructions can be divided into oneor more modules/units, and the one or more modules/units are stored inthe storage device 12 and executed by the at least one processor 13. Theone or more modules/units can be a series of computer-readableinstruction segments capable of performing specific functions, and theinstruction segments are used to describe execution processes of thecomputer-readable instructions in the electronic device 1. For example,the computer-readable instruction can be divided into the acquisitionmodule 110, the map module 111, the detection module 112, the extractionmodule 113, the determination module 114, the fusion module 115, thedividing module 116, the training module 117, the adjustment module 118,the calculation module 119, the enhancement module 120, the generationmodule 121, the encryption module 122, and the sending module 123 asshown in FIG. 3.

The storage device 12 can be configured to store the computer-readableinstructions and/or modules/units. The processor 13 may run or executethe computer-readable instructions and/or modules/units stored in thestorage device 12 and may call up data stored in the storage device 12to implement various functions of the electronic device 1. The storagedevice 12 mainly includes a storage program area and a storage dataarea. The storage program area may store an operating system, and anapplication program required for at least one function (such as a soundplayback function, an image playback function, for example), forexample. The storage data area may store data (such as audio data, phonebook data, for example) created according to the use of the electronicdevice 1. In addition, the storage device 12 may include a high-speedrandom access memory, and may also include a non-transitory storagemedium, such as a hard disk, an internal memory, a plug-in hard disk, asmart media card (SMC), a secure digital (SD) Card, a flashcard, atleast one disk storage device, a flash memory device, or anothernon-transitory solid-state storage device.

The storage device 12 may be an external memory and/or an internalmemory of the electronic device 1. The storage device 12 may be a memoryin a physical form, such as a memory stick, a Trans-flash Card (TFcard), for example.

When the modules/units integrated into the electronic device 1 areimplemented in the form of software functional units having been sold orused as independent products, they can be stored in a non-transitoryreadable storage medium. Based on this understanding, all or part of theprocesses in the methods of the above embodiments implemented by thepresent disclosure can also be completed by related hardware instructedby computer-readable instructions. The computer-readable instructionscan be stored in a non-transitory readable storage medium. Thecomputer-readable instructions, when executed by the processor, mayimplement the steps of the foregoing method embodiments. Thecomputer-readable instructions include computer-readable instructioncodes, and the computer-readable instruction codes can be in a sourcecode form, an object code form, an executable file, or some intermediateform. The non-transitory readable storage medium can include any entityor device capable of carrying the computer-readable instruction code,such as a recording medium, a U disk, a mobile hard disk, a magneticdisk, an optical disk, a computer memory, or a read-only memory (ROM).

With reference to FIG. 2, the storage device 12 in the electronic device1 stores a plurality of instructions to implement a method for measuringa growth height of a plant, and the processor 13 can execute themultiple instructions to: obtain a color image and a depth image of aplant to be detected; obtain a target image by performing a mappingprocessing on the color image and the depth image; detect the colorimage by using a pre-trained mobilenet-ssd network, and obtain adetection box comprising the plant to be detected; extract a targetcontour of the plant to be detected from the detection box; determine adepth value of each of pixel points in the target contour according tothe target image; and perform a denoising processing on depth values ofthe pixel points, and obtain target depth values, and determine a heightof the plant to be detected according to the target depth values.

The computer-readable instructions are executed by the processor 13 torealize the functions of each module/unit in the above-mentioned deviceembodiments, which will not be repeated here.

In the several embodiments provided in the preset application, thedisclosed electronic device and method can be implemented in other ways.For example, the embodiments of the devices described above are merelyillustrative. For example, divisions of the modules are based on logicalfunction only, and there can be other manners of division in actualimplementation.

In addition, each functional module in each embodiment of the presentdisclosure can be integrated into one processing module, or can bephysically present separately in each unit or two or more modules can beintegrated into one module. The above modules can be implemented in aform of hardware or in a form of a software functional unit.

Therefore, the present embodiments are considered as illustrative andnot restrictive, and the scope of the present disclosure is defined bythe appended claims. All changes and variations in the meaning and scopeof equivalent elements are included in the present disclosure. Anyreference sign in the claims should not be construed as limiting theclaim.

Moreover, the word “comprising” does not exclude other units nor doesthe singular exclude the plural. A plurality of units or devices statedin the system claims may also be implemented by one unit or devicethrough software or hardware. Words such as “first” and “second” areused to indicate names, but not in any particular order.

Finally, the above embodiments are only used to illustrate technicalsolutions of the present disclosure and are not to be taken asrestrictions on the technical solutions. Although the present disclosurehas been described in detail with reference to the above embodiments,those skilled in the art should understand that the technical solutionsdescribed in one embodiment can be modified, or some of the technicalfeatures can be equivalently substituted, and that these modificationsor substitutions are not to detract from the essence of the technicalsolutions or from the scope of the technical solutions of theembodiments of the present disclosure.

What is claimed is:
 1. A method for determining a height of a plant, themethod comprising: obtaining a color image and a depth image of a plantto be detected; obtaining a target image by performing a mappingprocessing on the color image and the depth image; detecting the colorimage by using a pre-trained mobilenet-ssd network, and obtaining adetection box comprising the plant to be detected; extracting a targetcontour of the plant to be detected from the detection box; determininga depth value of each of pixel points in the target contour according tothe target image; and performing a denoising processing on depth valuesof the pixel points, obtaining target depth values, and determining aheight of the plant to be detected according to the target depth values.2. The method for determining a height of a plant of claim 1, whereinobtaining a color image and a depth image of a plant to be detectedcomprises at least one of the following: controlling a first lens of acamera device to capture the plant to be detected, obtaining the colorimage, and controlling a second lens of the camera device to capture theplant to be detected, and obtaining the depth image; or determining alabel of the plant to be detected, obtaining an image corresponding tothe label from a first configuration library as the color image, andobtaining an image corresponding to the label from a secondconfiguration library as the depth image.
 3. The method for determininga height of a plant of claim 2, wherein performing the denoisingprocessing on the depth values of the pixel points, obtaining the targetdepth values, and determining the height of the plant to be detectedaccording to the target depth values comprises: determining a depthvalue as a zero value, the determined depth value being equal to apreset value; performing the denoising processing by deleting the zerovalue from the depth values of the pixel points, and determiningremaining depth values as the target depth values; determining a numberof the target depth values; obtaining a sum by counting the target depthvalues; calculating a distance between the plant to be detected and thecamera device by dividing the sum by the number of the target depthvalues; determining a height of a location where the camera device islocated; and determining the height of the plant to be detected bysubtracting the distance from the height of the camera device.
 4. Themethod for determining a height of a plant of claim 1, wherein obtainingthe target image by performing the mapping processing on the color imageand the depth image comprises: acquiring depth pixel points on the depthimage; mapping the depth pixel points to a preset depth coordinatesystem, and obtaining depth coordinates of the depth pixel points;determining global coordinates of the depth pixel points according tothe depth coordinates and a preset global coordinate system; determiningpositions of the depth pixel points on the color image according to theglobal coordinates of the depth pixel points, and determining colorpixel points corresponding to the positions on the color image; andobtaining the target image by merging each of the depth pixel pointswith corresponding color pixel points.
 5. The method for determining aheight of a plant of claim 1, wherein detecting the color image by usingthe pre-trained mobilenet-ssd network, and obtaining the detection boxcomprising the plant to be detected comprises: acquiring a depthconvolution kernel and a point convolution kernel in the mobilenet-ssdnetwork; extracting features of the color image with the depthconvolution kernel, and obtaining a feature map; and processing thefeature map with the point convolution kernel and obtaining thedetection box.
 6. The method for determining a height of a plant ofclaim 1, wherein extracting the target contour of the plant to bedetected from the detection box comprises: deleting a background imagefrom the detection box, and obtaining a grayscale image; and detectingthe target contour of the plant to be detected on the grayscale image.7. The method for determining a height of a plant t of claim 1, whereindetermining the depth value of each of the pixel points in the targetcontour according to the target image comprises: determining a targetposition of each of the pixel points on the target image; and obtaininga depth value at the target position from the target image as the depthvalue of each of the pixel points.
 8. An electronic device comprising: aprocessor; and a storage device storing a plurality of instructions,which when executed by the processor, cause the processor to: obtain acolor image and a depth image of a plant to be detected; obtain a targetimage by performing a mapping processing on the color image and thedepth image; detect the color image by using a pre-trained mobilenet-ssdnetwork, and obtain a detection box comprising the plant to be detected;extract a target contour of the plant to be detected from the detectionbox; determine a depth value of each of pixel points in the targetcontour according to the target image; and perform a denoisingprocessing on depth values of the pixel points, obtain target depthvalues, and determine a height of the plant to be detected according tothe target depth values.
 9. The electronic device of claim 8, whereinthe processor is further caused to perform at least one of thefollowing: control a first lens of a camera device to capture the plantto be detected, obtain the color image, and control a second lens of thecamera device to capture the plant to be detected, and obtain the depthimage; or determine a label of the plant to be detected, obtain an imagecorresponding to the label from a first configuration library as thecolor image, and obtain an image corresponding to the label from asecond configuration library as the depth image.
 10. The electronicdevice of claim 9, wherein the processor is further caused to: determinea depth value as a zero value, the determined depth value being equal toa preset value; perform the denoising processing by deleting the zerovalue from the depth values of the pixel points, and determine remainingdepth values as the target depth values; determine a number of thetarget depth values; obtain a sum by counting the target depth values;calculate a distance between the plant to be detected and the cameradevice by dividing the sum by the number of the target depth values;determine a height of a location where the camera device is located; anddetermine the height of the plant to be detected by subtracting thedistance from the height of the camera device.
 11. The electronic deviceof claim 8, wherein the processor is further caused to: acquire depthpixel points on the depth image; map the depth pixel points to a presetdepth coordinate system, and obtain depth coordinates of the depth pixelpoints; determine global coordinates of the depth pixel points accordingto the depth coordinates and a preset global coordinate system;determine positions of the depth pixel points on the color imageaccording to the global coordinates of the depth pixel points, anddetermine color pixel points corresponding to the positions on the colorimage; and obtain the target image by merging each of the depth pixelpoints with corresponding color pixel points.
 12. The electronic deviceof claim 8, wherein the processor is further caused to: acquire a depthconvolution kernel and a point convolution kernel in the mobilenet-ssdnetwork; extract features of the color image with the depth convolutionkernel, and obtain a feature map; and process the feature map with thepoint convolution kernel, and obtain the detection box.
 13. Theelectronic device of claim 8, wherein the processor is further causedto: delete a background image from the detection box, and obtain agrayscale image; and detect the target contour of the plant to bedetected on the grayscale image.
 14. The electronic device of claim 8,wherein the processor is further caused to: determine a target positionof each of the pixel points on the target image; and obtain a depthvalue at the target position from the target image as the depth value ofeach of the pixel points.
 15. A non-transitory storage medium havingstored thereon at least one computer-readable instructions that, whenexecuted by a processor of an electronic device, causes the processor toperform a method for determining a height of a plant, the methodcomprising: obtaining a color image and a depth image of a plant to bedetected; obtaining a target image by performing a mapping processing onthe color image and the depth image; detecting the color image by usinga pre-trained mobilenet-ssd network, and obtaining a detection boxcomprising the plant to be detected; extracting a target contour of theplant to be detected from the detection box; determining a depth valueof each of pixel points in the target contour according to the targetimage; and performing a denoising processing on depth values of thepixel points, obtaining target depth values, and determining a height ofthe plant to be detected according to the target depth values.
 16. Thenon-transitory storage medium of claim 15, wherein obtaining a colorimage and a depth image of a plant to be detected comprises at least oneof the following: controlling a first lens of a camera device to capturethe plant to be detected, obtaining the color image, and controlling asecond lens of the camera device to capture the plant to be detected,and obtaining the depth image; or determining a label of the plant to bedetected, obtaining an image corresponding to the label from a firstconfiguration library as the color image, and obtaining an imagecorresponding to the label from a second configuration library as thedepth image.
 17. The non-transitory storage medium of claim 16, whereinperforming the denoising processing on the depth values of the pixelpoints, obtaining the target depth values, and determining the height ofthe plant to be detected according to the target depth values comprises:determining a depth value as a zero value, the determined depth valuebeing equal to a preset value; performing the denoising processing bydeleting the zero value from the depth values of the pixel points, anddetermining remaining depth values as the target depth values;determining a number of the target depth values; obtaining a sum bycounting the target depth values; calculating a distance between theplant to be detected and the camera device by dividing the sum by thenumber of the target depth values; determining a height of a locationwhere the camera device is located; and determining the height of theplant to be detected by subtracting the distance from the height of thecamera device.
 18. The non-transitory storage medium of claim 15,wherein obtaining the target image by performing the mapping processingon the color image and the depth image comprises: acquiring depth pixelpoints on the depth image; mapping the depth pixel points to a presetdepth coordinate system, and obtaining depth coordinates of the depthpixel points; determining global coordinates of the depth pixel pointsaccording to the depth coordinates and a preset global coordinatesystem; determining positions of the depth pixel points on the colorimage according to the global coordinates of the depth pixel points, anddetermining color pixel points corresponding to the positions on thecolor image; and obtaining the target image by merging each of the depthpixel points with corresponding color pixel points.
 19. Thenon-transitory storage medium of claim 15, wherein detecting the colorimage by using the pre-trained mobilenet-ssd network, and obtaining thedetection box comprising the plant to be detected comprises: acquiring adepth convolution kernel and a point convolution kernel in themobilenet-ssd network; extracting features of the color image with thedepth convolution kernel, and obtaining a feature map; and processingthe feature map with the point convolution kernel, and obtaining thedetection box.
 20. The non-transitory storage medium of claim 15,wherein extracting the target contour of the plant to be detected fromthe detection box comprises: deleting a background image from thedetection box, and obtaining a grayscale image; and detecting the targetcontour of the plant to be detected on the grayscale image.